/**
 * Copyright (C) 2011 Audit Logger Project. All rights reserved.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.auditlogger.config.spi;

import java.security.PrivateKey;
import java.security.PublicKey;

/**
 * Allows the configuration of Audit Logger. 
 * <p>
 * A reference implementation is provided by <code>FilePropertiesConfigurator</code>.
 *  
 * @author <a href="mailto:ravi.sharda@gmail.com">Ravi Sharda</a>
 */
public abstract class PropertiesConfigurator {
	
	public abstract String getAppName();
	
	public abstract String getMessageDigestAlgorithm();
	
	public abstract String getEncryptionCipherTransformation();
	
	public abstract int getEncryptionCipherKeyLength();
	
	public String getRandomAlgorithm() {
		return defaultRandomAlgorithm();
	}
	
	public String getEncryptionAlgorithm() {
		return defaultEncryptionAlgorithm();
	}
	
	public String defaultEncryptionAlgorithm () {
		//return "AES";
		return "Blowfish";
	}
	
	public String defaultEncoding() {
		return "UTF-8";
	}
	
	public int defaultEncryptionKeyLength() {
		return 128;
	}
	
	public String defaultRandomAlgorithm() {
		return "SHA1PRNG";
	}
	
	public String getSignatureAlgorithm() {
		return defaultSignatureAlgorithm();
	}
	
	public String defaultSignatureAlgorithm() {
		return "DSA";
	}
	
	public String delimiter() {
		return "----";
	}
	
	public String startIndicator() {
		return "START";
	}
	
	public String endIndicator() {
		return "END";
	}
	
    public abstract byte[] getMasterKey();
	
	public abstract byte[] getMasterSalt();
	
	public abstract PrivateKey getSignerPrivateKey();
	
	public abstract PublicKey getSignerPublicKey();
}

